//
//  QDApplyCell.m
//  QuickDoctor
//
//  Created by ycw on 2016/12/26.
//  Copyright © 2016年 Eric. All rights reserved.
//

#import "QDApplyCell.h"

@implementation QDApplyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpUI];
        
    }
    return  self;
}

#pragma mark
#pragma mark - 搭建界面
- (void) setUpUI
{
    
    UILabel *lblPatient = [[UILabel alloc] init];
    
    [self.contentView addSubview:lblPatient];
    
    self.lblPatient = lblPatient;
    
    [lblPatient mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.top.equalTo(self.contentView).mas_offset(10);
        
        make.width.mas_offset(120);
        
    }];
    
    UILabel *lblDoctor = [[UILabel alloc] init];
    
    lblDoctor.text = @"马医生 主任医生";
    
    [self.contentView addSubview:lblDoctor];
    
    [lblDoctor mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(lblPatient);
        
        make.bottom.equalTo(self.contentView).mas_offset(-10);
        
        make.width.mas_equalTo(140);
        
    }];
    
    UILabel *lblTime = [[UILabel alloc] init];
    
    lblTime.text = @"就诊: 2016/06/19";
    
    [self.contentView addSubview:lblTime];
    
    [lblTime mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(lblPatient);
        
        make.leading.equalTo(lblPatient.mas_trailing).mas_offset(10);
        
        make.width.mas_equalTo(140);
        
    }];
    
    UILabel *lblAddress = [[UILabel alloc] init];
    
    lblAddress.text = @"上海长征医院";
    
    [self.contentView addSubview:lblAddress];
    
    [lblAddress mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(lblDoctor);
        
        make.leading.equalTo(lblDoctor.mas_trailing).mas_offset(30);
        
        make.width.mas_equalTo(120);
        
    }];
    
    UIView *line = [[UIView alloc] init];
    
    [self.contentView addSubview:line];
    
    line.backgroundColor = [UIColor colorWithRed:111/255.0 green:148/255.0 blue:170/255.0 alpha:1];
    
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(lblDoctor);
        
        make.height.mas_equalTo(1);
        
        make.centerY.equalTo(self.contentView);
        
        make.trailing.equalTo(self.contentView).mas_equalTo(-80);
        
    }];
    
    UIImageView *imgV = [[UIImageView alloc] init];
    
    imgV.backgroundColor = [UIColor colorWithRed:23/255.0 green:188/255.0 blue:187/255.0 alpha:1];
    
    imgV.layer.masksToBounds = YES;
    
    imgV.layer.cornerRadius = 30;
    
    [self.contentView addSubview:imgV];
    
    [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.equalTo(line.mas_trailing);
        
        make.top.equalTo(lblPatient);
        
        make.height.width.mas_equalTo(60);
        
        make.bottom.equalTo(self.contentView).mas_offset(-10);
        
    }];
    
    UILabel *lblImage = [[UILabel alloc] init];
    
    [imgV addSubview:lblImage];
    
    lblImage.text = @"审核中";
    
    [lblImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.center.equalTo(imgV);
        
        make.width.mas_equalTo(60);
        
        make.height.mas_equalTo(20);
        
    }];
    
}








@end
